package com.spring.mybatis;

import com.spring.mybatis.config.MybatisConfig;
import com.spring.mybatis.dao.UserMapper;
import com.spring.mybatis.service.UserService;
import com.spring.mybatis.service.impl.UserServiceImpl;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.EnableTransactionManagement;



@Configuration
public class MybatisDemoTest {
	public static void main(String[] args) {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(MybatisConfig.class);
		UserMapper userMapper = context.getBean("userMapper", UserMapper.class);
		System.out.println(userMapper.queryUser());
		UserServiceImpl userServiceImpl = context.getBean("userServiceImpl", UserServiceImpl.class);
		userServiceImpl.test2();

	}
}
